package model;

public class User { // 用户类 完成人:姜凯严 7/1
    public enum PermissionLevel {
        admin, normal
    }
    private int userId;
    private String username;
    private String password;
    private String address;
    private String phone;
    private double balance;
    private PermissionLevel permissionLevel; 

    // 构造方法、getter和setter
    public User() {
        this.permissionLevel = PermissionLevel.normal;
    }

    public User(int userId, String username, String password, String address, String phone, double balance, PermissionLevel permissionLevel) {
        this.userId = userId;
        this.username = username;
        this.password = password;
        this.address = address;
        this.phone = phone;
        this.balance = balance;
        this.permissionLevel = permissionLevel;
    }

    public int getUserId() { return userId; }
    public void setUserId(int userId) { this.userId = userId; }

    public String getUsername() { return username; }
    public void setUsername(String username) { this.username = username; }

    public String getPassword() { return password; }
    public void setPassword(String password) { this.password = password; }

    public String getAddress() { return address; }
    public void setAddress(String address) { this.address = address; }

    public String getPhone() { return phone; }
    public void setPhone(String phone) { this.phone = phone; }

    public double getBalance() { return balance; }
    public void setBalance(double balance) { this.balance = balance; }

    public PermissionLevel getPermissionLevel() { return permissionLevel; }
    public void setPermissionLevel(PermissionLevel permissionLevel) { this.permissionLevel = permissionLevel; }
    public void setPermissionLevel(String permissionLevel) {
        this.permissionLevel = PermissionLevel.valueOf(permissionLevel);
    }
}
